package com.yaodian100.ec.survey.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

import com.yaodian100.core.common.entity.BaseEntity;

@Entity
@Table(name = "EC_SURVEY_MAIN")
public class Survey extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7440951931504281701L;
	/**
	 * 问卷代碼, UUID
	 */
	@Id
	@GeneratedValue(generator = "gen_uuid")
	@GenericGenerator(name = "gen_uuid", strategy = "uuid")
	@Column(name = "id", length = 50)
	private String id;

	/**
	 * 问卷名稱
	 */
	@Column(name = "NAME", nullable = false, length = 20)
	private String name;

	/**
	 * 起始時間
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_DATE", nullable = false)
	private Date startDate;

	/**
	 * 結束時間
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "END_DATE", nullable = false)
	private Date endDate;

	/**
	 * 问卷内容
	 */
	@Transient
	private String template;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getTemplate() {
		return template;
	}

	public void setTemplate(String template) {
		this.template = template;
	}
}